<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./lib/jquery.min.js"></script>
</head>
<body>
    <button id="btnPost">post发送请求</button>
    <script>
        //入口函数
        $(function() {
            $('#btnPost').on('click',function() {
                $.ajax({
                    type:'POST',
                    url:'http://www.liulongbin.top:3006/api/addbook',
                    data:{
                        bookname:'老人与海',
                        author:'海明威',
                        publisher:'美国',
                    },
                    success:function(res) {
                        console.log(res);
                        
                    }
                })
            })
        })
    </script>
</body>
</html>